package com.xiongwei.compasite;

import java.util.ArrayList;
import java.util.List;

public class College extends Organization {

    private List<Organization> departments = new ArrayList<>();

    public College(String name) {
        super(name);
    }

    @Override
    public void add(Organization o) {
        this.departments.add(o);
    }

    @Override
    public void remove(Organization o) {
        this.departments.remove(o);
    }

    @Override
    public void print() {
        System.out.println("--------------" + getName() + "--------------");
        for (Organization department : departments) {
            department.print();
        }
    }
}
